package com.heima.admin.config;

import com.heima.admin.interceptor.AdInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 将自定义的拦截器注册到spring容器中
 */
@Configuration
public class AdConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AdInterceptor()).addPathPatterns("/**");
    }
}
